<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link rel="stylesheet" href="../../addons/party_member/public/css/weui.min.css">
    <link rel="stylesheet" href="../../addons/party_member/public/css/jquery-weui.min.css">

    <!-- body 最后 -->
    <script src="../../addons/party_member/public/js/jquery.min.js"></script>
    <script src="../../addons/party_member/public/js/jquery-weui.min.js"></script>

    <!-- 如果使用了某些拓展插件还需要额外的JS -->
    <script src="../../addons/party_member/public/js/swiper.min.js"></script>
    <script src="../../addons/party_member/public/js/city-picker.min.js"></script>
    <script src="../../addons/party_member/public/js/function.js"></script>
    <style>
        body{
            margin: 0px;
            padding: 0px;

        }
        .box{
            position: absolute;
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            background: url("../addons/party_member/public/image/login/loginbg.png") no-repeat;
            background-size: cover;

        }
        .head_return{
            display: inline-block;
            position: absolute;
            left: 10px;
            top: 10px;
            width: 20px;
            height: 23px;
            background: url("../addons/party_member/public/image/evaluation/return.png") no-repeat;
            background-size: 12px 23px;

        }
        .btn{
            text-align: center;
            margin-top: 30px
        }
        .btn input{
            width: 40%;
            height: 50px;
            font-size: 20px;
            font-weight: bold;
            margin: 0 4%;
        }

        .footer{
            position: absolute;
            bottom: 0px;
            height: 50px;
            width: 100%;
            line-height: 50px;
            text-align: center;
            color: #ffffff;
        }
        .footer div{
            margin: auto;
            width: 92%;
            height: 1px;
            background-color: #ffffff;
            display: block;
        }
        .weui-cell:before{

            border:none;
        }
        .weui-cell:after{
            content: " ";
            position: absolute;
            bottom: 0;
            right: 15px;
            height: 1px;
            border-top: 2px solid #ffffff;
            color: #d9d9d9;
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
            -webkit-transform: scaleY(.5);
            transform: scaleY(.5);
            left: 15px;
        }
        .weui-cells:after{
            border: none;
        }
        .weui-cells:before{
            border: none;
        }
        @media screen and (max-height: 400px) {
            .footer {
                display: none;
            }
        }

    </style>
</head>
<body>
<div class="box">
<div class="weui-cells__title" style="font-weight: bold;color:#000000;margin-top:0px;background-color: #ffffff;height: 43px;text-align: center;font-size: 18px;line-height: 43px;">
    <span class="head_return"></span>
    账号登录
</div>
<div class="weui-cells weui-cells_form" style="margin-top: 0px;background: none;color: #ffffff;border: none">
    <div class="weui-cell"  style="height: 35px">
        <div class="weui-cell__hd"><label class="weui-label" >手机号码</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" name="phone"  type="number" pattern="[0-9]*" placeholder="请输入手机号">
        </div>
    </div>
    <div class="weui-cell"  style="height: 35px;">
        <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" name="password" type="password"  placeholder="请输入密码">
        </div>
    </div>
 <!--   <div class="weui-cell weui-cell_vcode">
        <div class="weui-cell__hd">
            <label class="weui-label">验证码</label>
        </div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="tel" placeholder="请输入验证码">
        </div>
        <div class="weui-cell__ft">
            <button class="weui-vcode-btn">获取验证码</button>
        </div>
    </div>-->
    <div class="weui-cell weui-cell_vcode"  style="height: 55px;">
        <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="number" name="code" placeholder="请输入验证码">
        </div>
        <div class="weui-cell__ft" style="border-left:1px solid #ffffff;margin-right: 10px">
            <img width="60"  id="code" style="background-color: #ffffff"  class="weui-vcode-img" src="{php echo $this->createMobileUrl('getCode')}" >
        </div>
    </div>
</div>
    <div class="btn">
        <input class="weui-btn weui-btn_mini weui-btn_warn" type="submit" name="subimt" value="确认"/>
        <a href="{php echo $this->createMobileUrl('PwdModify')}">
            <input class="weui-btn weui-btn_mini weui-btn_warn" type="submit" value="修改密码"/>
        </a>
    </div>
<div class="footer">
    <div></div>
    <p>忘记密码请联系支部管理员</p>
</div>
</div>
<script>

    $(function () {

        //点击刷新验证码
        $('#code').click(function () {
            refresh();
        })

        $('input[name="subimt"]').click(function () {
            var phone=$('input[name="phone"]').val();
            var password=$('input[name="password"]').val();
            var code=$('input[name="code"]').val();
            var reg=/^1[34578]\d{9}$/;
            if (phone==""){
                $.alert("请输入手机号");
                return
            }
            if (!reg.test(phone)){
                $.alert("请输入正确手机号");
                return
            }
            if (password==""){
                $.alert("请输入密码");
                return
            }
            if(code==""){
                $.alert("请输入验证码");
                return
            }

            $.showLoading();
            $.post('{php echo $this->createMobileUrl("loginAjax")}',{
                phone:phone,
                password:password,
                code:code
            },function (data) {
                $.hideLoading();
                if(data['status']){
                    $.alert(data['result'], "提示",function () {
                        window.location.href="{$jumpurl}"
                    });

                }else{
                    $.alert(data['result'], "提示",function () {
                        refresh();
                    });
                }
            },'json')
        })


    })

    function test(){
        $("input[name='phone']").val("13344556677")
        $("input[name='password']").val("123456")

    }

    function refresh() {
        var timestamp = new Date().getTime();
        $('#code').attr('src',$('#code')[0].src)
        $('#code').attr("src", $('#code')[0].src + '&pass_key='+timestamp);
    }

</script>
</body>
</html>